import request from '@/utils/request'

// 获取通知列表
export function getNotificationList(params) {
  return request({
    url: '/api/notification/list',
    method: 'get',
    params,
  })
}

// 获取通知详情
export function getNotificationDetail(id) {
  return request({
    url: `/api/notification/${id}`,
    method: 'get',
  })
}

// 标记通知为已读
export function markNotificationAsRead(id) {
  return request({
    url: `/api/notification/${id}/read`,
    method: 'Post',
  })
}

// 获取消息列表
export function getMessageList(params) {
  return request({
    url: '/api/message/list',
    method: 'get',
    params,
  })
}

// 获取未读消息数量
export function getUnreadMessageCount() {
  return request({
    url: '/api/message/unread-count',
    method: 'get',
  })
}

// 标记消息为已读
export function markMessageAsRead(id) {
  return request({
    url: `/api/message/${id}/read`,
    method: 'put',
  })
}

// 标记所有消息为已读
export function markAllMessagesAsRead() {
  return request({
    url: '/api/message/read-all',
    method: 'put',
  })
}

// 删除消息
export function deleteMessage(id) {
  return request({
    url: `/api/message/${id}`,
    method: 'delete',
  })
}
